<template>
  <div class="van-doc-demo-block">
    <h2 v-if="title" class="van-doc-demo-block_title">{{ title }}</h2>
    <div v-if="card" class="van-doc-demo-block_card">
      <slot />
    </div>
    <slot v-else />
  </div>
</template>

<script>
export default {
  name: 'DemoBlock',

  props: {
    card: Boolean,
    title: String,
  },
};
</script>

<style lang="css" scoped="scoped">

.van-doc-demo-block_title {
	margin: 0;
	padding: 32px 16px 16px;
	color: rgba(69, 90, 100, 0.6);
	font-weight: normal;
	font-size: 14px;
	line-height: 16px;
}

.van-doc-demo-block_card {
	margin: 12px 12px 0;
	overflow: hidden;
	border-radius: 8px;
}

.van-doc-demo-block_title .van-doc-demo-block_card {
	margin-top: 0;
}
.van-doc-demo-block_ {
	
}
.van-doc-demo-block_title :first-of-type {
	padding-top: 20px;
}
</style>